#include <stdio.h>
#include <signal.h>

static void signal_user( int );

static void signal_user( int sig )
{
	if ( sig == SIGUSR1 ) 
		printf( "Catch signal SIGUSR1 %d\n", sig );

	if ( sig == SIGUSR2 ) 
		printf( "Catch signal SIGUSR2 %d\n", sig );
}

int main( void )
{

	if ( signal( SIGUSR1, signal_user ) == SIG_ERR ) {
		printf( "Cant catch SIGUSER1.\n" );
		return -1;
	}

	if ( signal( SIGUSR2, signal_user ) == SIG_ERR ) {
		printf( "Cant catch SIGUSER2.\n" );
		return -1;
	}
#if 0
	if ( signal( SIGTERM, signal_user ) == SIG_ERR ) {
		printf( "Cant catch SIGUSER2.\n" );
		return -1;
	}

#endif
	for ( ; ; )
		pause();


	return 0;
}
